home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / system.ads < prev    next >
Text File  |  1994-05-19  |  4KB  |  91 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                               S Y S T E M                                --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.14 $                             --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  Note: although the values in System are target dependent, the source of
  26. --  the package System itself is target independent in GNAT. This is achieved
  27. --  by using attributes for all values, including the special additional GNAT
  28. --  Standard attributes that are provided for exactly this purpose.
  29.  
  30. package System is
  31.    pragma Pure (System);
  32.  
  33.    type Name is (GNAT);
  34.    System_Name : constant Name := GNAT;
  35.  
  36.    --  System-Dependent Named Numbers
  37.  
  38.    Min_Int                : constant := Long_Long_Integer'First;
  39.    Max_Int                : constant := Long_Long_Integer'Last;
  40.    Max_Binary_Modulus     : constant := 2 ** Long_Long_Integer'Size;
  41.    Max_Nonbinary_Modulus  : constant := Integer'Last;
  42.    Max_Base_Digits        : constant := Long_Long_Float'Digits;
  43.    Max_Digits             : constant := Long_Long_Float'Digits;
  44.    Max_Mantissa           : constant := Long_Long_Integer'Size - 1;
  45.    Fine_Delta             : constant := 2.0 ** (-Max_Mantissa);
  46.    Tick                   : constant := Standard'Tick;
  47.  
  48.    --  Storage related Declarations
  49.  
  50.    type Address is private;
  51.    Null_Address : constant Address;
  52.  
  53.    Storage_Unit           : constant := Standard'Storage_Unit;
  54.    Word_Size              : constant := Standard'Word_Size;
  55.    Memory_Size            : constant := 2 ** Standard'Address_Size;
  56.  
  57.    --  Address comparison
  58.  
  59.    function "<"  (Left, Right : Address) return Boolean;
  60.    function "<=" (Left, Right : Address) return Boolean;
  61.    function ">"  (Left, Right : Address) return Boolean;
  62.    function ">=" (Left, Right : Address) return Boolean;
  63.    function "="  (Left, Right : Address) return Boolean;
  64.  
  65.    pragma Import (Intrinsic, "<");
  66.    pragma Import (Intrinsic, "<=");
  67.    pragma Import (Intrinsic, ">");
  68.    pragma Import (Intrinsic, ">=");
  69.    pragma Import (Intrinsic, "=");
  70.  
  71.    --  Declarations for real time Annex (Annex H)
  72.  
  73.    subtype Any_Priority is Integer
  74.      range 0 .. Standard'Max_Interrupt_Priority;
  75.  
  76.    subtype Priority is Any_Priority
  77.      range 0 .. Standard'Max_Priority;
  78.  
  79.    subtype Interrupt_Priority is Any_Priority
  80.      range Standard'Max_Priority + 1 .. Standard'Max_Interrupt_Priority;
  81.  
  82.    Default_Priority : constant Priority :=
  83.      (Priority'First + Priority'Last) / 2;
  84.  
  85. private
  86.  
  87.    type Address is mod Memory_Size;
  88.    Null_Address : constant Address := 0;
  89.  
  90. end System;
  91.